% This function tests if the color is a combination of the existing ones
function res = isCombinationOfColors(color, colors)

% First find colors that smaller than color in all channels
rep = repmat(color,[size(colors,1), 1 1]);
diff = rep - colors;
inds = sum(diff > -0.03,2)==3;

% Generating a combination of colors from the relevant colors only
space = generateAddativeColorSpace(colors(inds,:), 3);
space = min(space,1);

rep = repmat(color,[size(space,1), 1 1]);

diff = space - rep;
diff = sqrt(sum(diff .* diff,2))
diff = min(diff);

if(diff > 0.05)
    res = 0;
else
    res = 1;
end


